/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.sonrisas.tools.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author DIEGOALV
 */
@Entity
@Table(name = "privilegio")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Privilegio.findAll", query = "SELECT p FROM Privilegio p"),
    @NamedQuery(name = "Privilegio.findById", query = "SELECT p FROM Privilegio p WHERE p.id = :id"),
    @NamedQuery(name = "Privilegio.findByVer", query = "SELECT p FROM Privilegio p WHERE p.ver = :ver"),
    @NamedQuery(name = "Privilegio.findByEditar", query = "SELECT p FROM Privilegio p WHERE p.editar = :editar"),
    @NamedQuery(name = "Privilegio.findByCrear", query = "SELECT p FROM Privilegio p WHERE p.crear = :crear"),
    @NamedQuery(name = "Privilegio.findByBorrar", query = "SELECT p FROM Privilegio p WHERE p.borrar = :borrar"),
    @NamedQuery(name = "Privilegio.findByImprimir", query = "SELECT p FROM Privilegio p WHERE p.imprimir = :imprimir"),
    @NamedQuery(name = "Privilegio.findByIdUsuario", query = "SELECT p FROM Privilegio p WHERE p.idUsuario = :idUsuario"),
    @NamedQuery(name = "Privilegio.findByFechaCreacion", query = "SELECT p FROM Privilegio p WHERE p.fechaCreacion = :fechaCreacion"),
    @NamedQuery(name = "Privilegio.findByFechaModificacion", query = "SELECT p FROM Privilegio p WHERE p.fechaModificacion = :fechaModificacion")})
public class Privilegio implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Column(name = "ver")
    private Boolean ver;
    @Column(name = "editar")
    private Boolean editar;
    @Column(name = "crear")
    private Boolean crear;
    @Column(name = "borrar")
    private Boolean borrar;
    @Column(name = "imprimir")
    private Boolean imprimir;
    @Column(name = "IdUsuario")
    private Integer idUsuario;
    @Column(name = "FechaCreacion")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaCreacion;
    @Column(name = "FechaModificacion")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaModificacion;
    @JoinColumn(name = "Item_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Item itemid;
    @JoinColumn(name = "Perfil_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Perfil perfilid;

    public Privilegio() {
    }

    public Privilegio(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Boolean getVer() {
        return ver;
    }

    public void setVer(Boolean ver) {
        this.ver = ver;
    }

    public Boolean getEditar() {
        return editar;
    }

    public void setEditar(Boolean editar) {
        this.editar = editar;
    }

    public Boolean getCrear() {
        return crear;
    }

    public void setCrear(Boolean crear) {
        this.crear = crear;
    }

    public Boolean getBorrar() {
        return borrar;
    }

    public void setBorrar(Boolean borrar) {
        this.borrar = borrar;
    }

    public Boolean getImprimir() {
        return imprimir;
    }

    public void setImprimir(Boolean imprimir) {
        this.imprimir = imprimir;
    }

    public Integer getIdUsuario() {
        return idUsuario;
    }

    public void setIdUsuario(Integer idUsuario) {
        this.idUsuario = idUsuario;
    }

    public Date getFechaCreacion() {
        return fechaCreacion;
    }

    public void setFechaCreacion(Date fechaCreacion) {
        this.fechaCreacion = fechaCreacion;
    }

    public Date getFechaModificacion() {
        return fechaModificacion;
    }

    public void setFechaModificacion(Date fechaModificacion) {
        this.fechaModificacion = fechaModificacion;
    }

    public Item getItemid() {
        return itemid;
    }

    public void setItemid(Item itemid) {
        this.itemid = itemid;
    }

    public Perfil getPerfilid() {
        return perfilid;
    }

    public void setPerfilid(Perfil perfilid) {
        this.perfilid = perfilid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Privilegio)) {
            return false;
        }
        Privilegio other = (Privilegio) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Privilegio[ id=" + id + " ]";
    }
    
}
